define(['app'], function( appCRM ) {
    'use strict';
    /*面板管理*/
      appCRM.controller('Dashboard', function($scope, dataFactoryCRM, $q) {
        $scope.dashboards;
        $scope.dashspage = {
          pageAll: 1,
          pageNow: 1,
          pageSize: 8,
          k: 11
        };

        $scope.getDashList = function() {
          var _url = 'dashboard/index?p=' + $scope.dashspage.pageNow + '&psize=' + $scope.dashspage.pageSize;
          dataFactoryCRM.getDataByAPI(_url).then(function(_d) {
            if (_d.rcode) {
              $scope.dashspage.pageSize = _d.psize;
              $scope.dashspage.pageAll = _d.pall;
              $scope.dashspage.pageNow = _d.p;
              $scope.dashboards = _d.data;
            } else {
              alert(_d.msg);
            }
          });
        }

        $scope.getDashList();

    });
});